package com.gitee.wsl.ext.bitcode


/** Returns a binary string representation of this [Byte] value. */
 fun Byte.toBinaryString(): String = (toInt() and 0xFF).toString(2).padStart(8, '0')

/** Returns a binary string representation of this [ByteArray] value. */
//fun ByteArray.toBinaryString(): String = joinToString(String.EMPTY) { it.toBinaryString() }

/** Returns a binary string representation of this [Int] value. */
 fun Int.toBinaryString(): String = toString(2)

/** Returns a binary string representation of this [Long] value. */
 fun Long.toBinaryString(): String = toString(2)

/** Returns a binary string representation of this [UByte] value. */
 fun UByte.toBinaryString(): String = toString(2).padStart(8, '0')

/** Returns a binary string representation of this [UByteArray] value. */
//@OptIn(ExperimentalUnsignedTypes::class)
//fun UByteArray.toBinaryString(): String = joinToString(String.EMPTY) { it.toBinaryString() }

/** Returns a binary string representation of this [UInt] value. */
 fun UInt.toBinaryString(): String = toString(2)

/** Returns a binary string representation of this [ULong] value. */
 fun ULong.toBinaryString(): String = toString(2)

